#ifndef _TWMJ_PROTOCOLMGR_H_
#define _TWMJ_PROTOCOLMGR_H_

#include "Common.h"
#include "String.h"
#include "Resource.h"
#include "Vector3.h"
#include "twmjn/TWMJGameStruct.h"
#include "twmjn/TWMJAIInterface.h"
#include "MailManager.h"
#include "ChannelManager.h"
#include "ProtocolsManager.h"
#include "MJEnum.h"
#include "MJStruct.h"
using std::vector;

using namespace AIScript;

class  CharPtr;
class  ItemPtr;
class  ChannelPtr;
class  UserPtr;
class  TownPtr;
class  MissionPtr;
class  EffectPtr;
class WSSocketPtr;


class TWMJProtocolsManager:public ProtocolsManager, public Singleton<TWMJProtocolsManager>
{
public:
	//		SMSG_ENTERROOM = 0x0011,			//加入房间
	bool 	CreateJoinGamePacket(WorldPacket * packet, const uint8 & type);

	//SMSS_TWMJ_chr = 0x0100,		//返回玩家信息
	bool 	CreateCharInforPacket(WorldPacket * packet,CharPtr & chr);
	
	//SMSS_TWMJ_targetchr = 0x0101,	//返回目标玩家信息
	bool 	CreateTargetCharInforPacket(WorldPacket * packet,CharPtr & chr);
	

	// SMSS_TWMJ_roomList = 0x0102,	//房间列表
	bool 	CreateRoomListPacket(WorldPacket * packet, std::list<TownPtr> * town_list);

	// SMSS_TWMJ_GoHall = 0x0103,	//进入大厅或者进入房间
	bool 	CreateGoHallPacket(WorldPacket * packet, const uint8 Where = 0);

	//SMSS_TCMJ_Ready = 0x0104,		//玩家准备
	bool 	CreatePlayerReadyPacket(WorldPacket * packet, const uint8 & type);


	// //SMSS_TWMJ_ChooseKouPaiNotify = 0x0105,	// 通知玩家扣牌
	// bool 	CreateKouPaiNotifyPacket(WorldPacket * packet, const uint32 & ui32LeftTime);

	// //SMSS_TWMJ_PlayerChooseKouPai = 0x0106,	// 玩家选扣牌
	// bool 	CreateChooseKouPaiPacket(WorldPacket * packet,const uint8 & ui8PlayerPosID, std::vector<uint8 > vecKouPaiList,const uint8 & result);

	//		SMSS_MJ_GameOverCalc = 0x2519,		//小结算
	bool 	CreateXiaoJieSuanPacket(WorldPacket * packet,std::vector<MJBaseTablePlayer* >  & vecPlayerList);


	/******************台湾麻将*******************/

	//SMSS_MJ_DrawOrder = 0x0115,抓牌顺序
	bool CreateDrawOrderPacket(WorldPacket *packet, std::vector<uint8> &Alignment1);
	//SMSS_MJ_DiceResult = 0x0116,发送骰子数
	bool CreateBroadcastDiceResultPacket(WorldPacket *packet, std::vector<uint8> &m_dice);
	//SMSS_MJ_ContinBank = 0x0117,连庄次数
	bool CreateBroadcastContinueBankerPacket(WorldPacket *packet, const TWMJTablePlayers *pTp);
	//	SMSS_MJ_GameOverCalc = 0x2519,结算
	bool CreateJieSuanPacket(WorldPacket * packet,std::vector<MJBaseTablePlayer* >  & vecPlayerList,std::vector<std::vector<uint8> >ui8HuaPaiList);
	//风圈信息
	bool CreateBroadCurrentWindPacket(WorldPacket *packet,const uint32 &rountid,const TWMJTablePlayers *pTp);
};

#endif
